#region MIT Licence
/*
 * Copyright (C) 2014 PdfCreative
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
 * and associated documentation files (the "Software"), to deal in the Software without restriction, 
 * including without limitation the rights to use, copy, modify, merge, publish, distribute, 
 * sublicense, and/or sell copies of the Software, and to permit persons to whom 
 * the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included 
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 
 * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
#endregion


namespace PdfCreative.Pdf.Writer
{
    /// <summary>
    /// The PdfPageTreeEntry class represents a page tree. A page tree is a simple page count and is used to build up a 
    /// comprehensive document page tree for a PDF document.
    /// </summary>
    internal class PdfPageTreeEntry
    {
        // Private fields
        // ==============
        #region Private fields
        private int _pageCount;
        private PdfObjectReference _objectReference;
        #endregion



        // Public properties
        // =================
        #region Public properties
        /// <summary>
        /// Retrieves the number of pages.
        /// </summary>
        public int PageCount
        {
            get { return _pageCount; }
        }

        /// <summary>
        /// Sets or retrieves the object reference for this page tree entry.
        /// </summary>
        public PdfObjectReference ObjectReference
        {
            get { return _objectReference; }
            set { _objectReference = value; }
        }
        #endregion



        // Object overrides
        // ================
        #region Object overrides
        /// <summary>
        /// Returns the string representation of this PdfObjectReference.
        /// </summary>
        /// <returns>The string representation</returns>
        public override string ToString()
        {
            return _objectReference.ToString();
        }
        #endregion



        // Public constructor
        // ==================
        #region Public constructor
        /// <summary>
        /// Constructs a new PdfPageTreeEntry instance.
        /// </summary>
        /// <param name="objectReference">The object reference for the page tree entry object.</param>
        /// <param name="pageCount">The number of pages in this entry.</param>
        public PdfPageTreeEntry(PdfObjectReference objectReference, int pageCount)
        {
            _pageCount = pageCount;
            _objectReference = objectReference;
        }
        #endregion
    } // PageTreeEntry
}
